package FrameWork.World;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

public class SceneThreadFactory implements ThreadFactory {

    private static AtomicInteger poolIdx = new AtomicInteger(0);
    private int currentPoolIdx = poolIdx.getAndIncrement();
    private AtomicInteger threadIdx = new AtomicInteger(0);
    private static final String SCENE_NAME="SceneThread";

    @Override
    public Thread newThread(Runnable r) {
        return new Thread(r,SCENE_NAME+"-"+currentPoolIdx+"-"+threadIdx.getAndIncrement());
    }


}
